package com.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @ClassName DemoServiceIHandler
 * @Description
 * @Author xinggh
 * @Date 2020/8/16 18:47
 * @Version 1.0
 **/
public class DemoServiceIHandler implements InvocationHandler {

    private DemoService demoService;

    public DemoServiceIHandler(DemoService demoService) {
        this.demoService = demoService;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("666  invoke");
        Object invoke = method.invoke(demoService, args);
        return invoke;
    }
}
